package com.lovo.csc.controller;

import com.lovo.csc.bean.TenderBean;
import com.lovo.csc.service.ITenderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("tender")
public class TenderController {

    @Autowired
    ITenderService tenderService;

    @GetMapping("findAllYear")
    public List<Integer> findAllYear(){
        return tenderService.findAllYear();
    }

    @GetMapping("findTitleByYear/{time}")
    public List<TenderBean> findTitleByYear(@PathVariable("time") String time){
        return tenderService.findTitleByYear(time);
    }
}
